package com.example.zqm.git72.Model;

import com.example.zqm.git72.Service.MasterService;
import com.example.zqm.git72.Service.UserService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/4/26.
 */

public class UserModel {
    private Retrofit retrofit;
    public UserModel(){

        //联网获取网络上的数据
         retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();

    }

    public Call login(String tel,String password)
    {
        UserService userService =retrofit.create(UserService.class);
        return userService.Login(tel,password);
    }
    public Call register(String password,String tel)
    {
        UserService userService =retrofit.create(UserService.class);
        return userService.Register(password,tel);
    }
    public Call getUser(String user_id){
        UserService userService = retrofit.create(UserService.class);
        return userService.getUser(user_id);
    }
    public Call update(String user_id,String password){
        UserService userService = retrofit.create(UserService.class);
        return userService.update(user_id,password);
    }
}
